home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / Developer Documentation / Recipes, Tech Notes & Articles / Recipes / Imaging & Layout / Frame Link Status
Encoding:
Text File  |  1996-04-21  |  3.7 KB  |  45 lines  |  [TEXT/ttxt]

  1. OpenDocâ„¢ Recipes
  2.  
  3. Frame Link Status
  4. By The OpenDoc Design Team
  5. April, 1996
  6.  
  7.  
  8. © 1993-1996  Apple Computer, Inc. All Rights Reserved.
  9. Apple, the Apple logo, AppleScript, Bento, Macintosh, QuickTime, and OpenDoc are 
  10. registered trademarks of Apple Computer, Inc.
  11. Finder, Mac, and QuickDraw are trademarks of Apple Computer, Inc. 
  12. SOM, SOMObjects, and System Object Model are licensed trademarks of IBM Corporation. 
  13.  
  14.  
  15. Introduction
  16.  
  17. Frames have a link status that indicates the frame's participation in links maintained by containing parts.  All OpenDoc parts that support embedding are responsible for ensuring that the link status of their embedded frames is set correctly.  This document summarizes the part responsibilities for a part that does not support linking.  Developers of parts supporting linking are referred to the Linking recipes for more information.
  18.  
  19. Implementing LinkStatusChanged
  20.  
  21. All parts that support embedding must implement ODPart::LinkStatusChanged.  All they must do is pass the notification along to all embedded frames by calling ODFrame::ChangeLinkStatus.  It is not necessary to internalize an embedded frame to make this call; it can be postponed until the embedded frame is internalized for some other reason.
  22.  
  23. (Newly documented for DR5)
  24.  
  25. If the frame passed to LinkStatusChanged has been opened into a  window, the displayed part should call the ChangeLinkStatus method of the root frame of the window.  This ensures that all frames in the window have their link status set correctly.  (Its not sufficient to call ChangeLinkStatus on only the frames embedded in that root frame!)  Note that if a part calls the ChangeLinkStatus method of one of its display frames, the  part's own LinkStatusChanged method will be called (in this case, recursively).
  26.  
  27. Internalizing an Embedded Frame
  28.  
  29. It is the responsibility of every part to ensure that the link status of their embedded frames is set correctly.  The easiest way for a part editor that does not support linking to do this is to call the frame's ChangeLinkStatus method immediately after internalizing the embedded frame.  Editors that don't support linking can specify the link status constant kODNotInLink;  ChangeLinkStatus will take the containing frame's link status into account in determining the link status value actually set.  For example:
  30.  
  31. ODFrame* embeddedFrame = myDraft->AcquireFrame(ev, embeddedFrameID);
  32. embeddedFrame->ChangeLinkStatus(ev, kODNotInLink);
  33.  
  34. Note: Parts that support linking must not specify the link status constant kODNotInLink if the frame is embedded within a link source or destination maintained by the part.  See the Linking recipes for more information on the link status value to use.
  35.  
  36. Embedding a Frame
  37.  
  38. Parts must set the link status of frames they embed, be it by a paste, drop, or some other means.  If the part does not support linking, it should call the frame's ChangeLinkStatus method immediately after the frame is embedded and internalized.
  39.  
  40. Determining the Link Status of a Display Frame
  41. (Newly documented for DR5)
  42.  
  43. Before your editor allows modification of a part's content, it must determine the link status of the frame in which it is being modified.   Your editor should be careful not to assume a display frame's link status is kODNotInLink; LinkStatusChanged won't be called when a display frame is reconnected unless the frame's link status has changed.  If your part caches the link status of its display frames, initialize the cached setting by calling GetLinkStatus on the frame when it is added or reconnected.
  44.  
  45. If the user attempts to modify part content in a frame with a link status of kODInLinkDestination, your editor should call the EditInLink method of the display frame.  Follow the steps described in the OpenDoc Programmer's Guide.